package com.lighting.lightingservice.controller;


import com.lighting.lightingservice.dto.Page;
import com.lighting.lightingservice.dto.PageList;
import com.lighting.lightingservice.mapper.PageListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class PageListController {

    @Autowired
    PageListMapper pageListMapper;

    @RequestMapping("/selectPage")
    @ResponseBody
    @CrossOrigin
    List<PageList> forData(){
        return  pageListMapper.findAll();

    }

    @PostMapping("/updatePage")
    @CrossOrigin
    void getPostData(@RequestBody Page page) {
        pageListMapper.update(page);

    }
}
